home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / gfx / lise2.1 / lise / src / tpo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-31  |  1.5 KB  |  66 lines

  1. #include <stdio.h>
  2. #ifdef AMIGA
  3. #include <gfxamiga.h>
  4. #else
  5. #include <gfx.h>
  6. #endif
  7.  
  8. help()
  9. {
  10. printf("print text on the grafic screen\n");
  11. printf("tpo x y [options] -t text\n");
  12. printf("options:\n");
  13. printf("   -w n         gives angle in degree\n");
  14. printf("   -xs n        sets size of characters (integers)\n");
  15. printf("   -ys n        sets size of characters (integers)\n");
  16. printf("   -xt n        sets repetition (thicknes) for x\n");
  17. printf("   -yt n        sets repetition (thicknes) for y\n");
  18. printf("   -font name   sets fontname\n");
  19. printf("   -c n         sets paper and ink colour\n");
  20. exit(0);
  21. }
  22.  
  23. main(argc,argv)
  24. int argc;
  25. char *argv[];
  26. {
  27. int x,y,i,n,
  28.    xsize=0,
  29.    ysize=0,
  30.    xthick=0,
  31.    ythick=0,
  32.    angle=0,
  33.    colour=0;
  34. char s[80],fontname[80];
  35.  
  36.    fontname[0]=0;
  37.    if(!checkopt(argc,argv,"-t",s)) help();
  38.    if(checkopt(argc,argv,"-w",s)) angle=atoi(s);
  39.    if(checkopt(argc,argv,"-xs",s)) xsize=atoi(s);
  40.    if(checkopt(argc,argv,"-ys",s)) ysize=atoi(s);
  41.    if(checkopt(argc,argv,"-xt",s)) xthick=atoi(s);
  42.    if(checkopt(argc,argv,"-yt",s)) ythick=atoi(s);
  43.    if(checkopt(argc,argv,"-font",s)) strcpy(fontname,s);
  44.    if(checkopt(argc,argv,"-c",s)) colour=atoi(s);
  45.  
  46.    tekopen();
  47.    textparam(xsize,ysize,xthick,ythick,angle,fontname);
  48.    if(colour>0) setcolour(colour);
  49.  
  50.    x=atoi(argv[1]);
  51.    y=atoi(argv[2]);
  52.  
  53.    strcpy(s,"");
  54.    n=0;
  55.    while(strcmp(argv[n],"-t")!=0) n++;
  56.    for(i=n+1;i<argc;i++) {
  57.       strcat(s," ");
  58.       strcat(s,argv[i]);
  59.    }
  60.    posita(x,y);
  61.    gfxtext(s,0.0);
  62.    gfxflush();
  63.    close(_tek4014);
  64.    exit(0);
  65. }
  66.